package com.learn.xueer.ui.activity

import android.os.Bundle
import com.learn.xueer.app.base.BaseActivity
import com.learn.xueer.databinding.ActivityQuestionBinding
import com.learn.xueer.ui.adapter.QuestionAdapter
import com.learn.xueer.ui.viewmodel.MineViewModel
import kotlinx.android.synthetic.main.activity_question.rv
import me.hgj.jetpackmvvm.util.startActivity

class QuestionActivity : BaseActivity<MineViewModel, ActivityQuestionBinding>() {
    private val questionAdapter: QuestionAdapter by lazy { QuestionAdapter(arrayListOf()) }

    override fun initView(savedInstanceState: Bundle?) {
        rv.adapter = questionAdapter
        mViewModel.problemReq {
            questionAdapter.setList(it)
        }
        mDatabind.click = ProxyClick()
    }

    inner class ProxyClick {
        fun back() {
            finish()
        }

        fun feedback() {
            startActivity(FeedBackActivity::class)
        }
    }
}